Blinking Text


Exercise 1

Create a simple HTML element and make its text blink continuously using setInterval. Create div with some text and make it so every second they should be visible or hide so like blinking

   
const text=document.getElementById('text');

let visible = false;

setInterval(() => {
  visible = !visible;
  text.style.display = visible ? "block" : "none";
}, 500);

Blinking Text